<div class="container">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="col-sm-6">
                <span class="glyphicon glyphicon-user">&nbsp;商城活动商品&nbsp;</span>
                <span class="glyphicon glyphicon-chevron-right">&nbsp;商品管理&nbsp;</span>
                <a href="javascript:window.history.go(-1);">返回</a>
            </div>
            <div class="col-sm-6">
                <div class="pull-right">
                    <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addGoods" ng-click="getAllCategories()">
                        <span class="glyphicon glyphicon-plus">添加</span>
                    </button>
                </div>
            </div>
        </div>
    </div>

    <table class="table table-striped" ng-init="getSpecialCommodities()">
        <tr>
            <th></th>
            <th>活动商品ID</th>
            <th>商品编号</th>
            <th>商品名称</th>
            <th>图片</th>
            <th>操作</th>
        </tr>
        <tr ng-repeat="item in aSpecialCommodities">
            <td>111{{$index+startIndex}}</td>
            <td>{{item.id}}</td>
            <td>{{item.commodityNo}}</td>
            <td>{{item.name}}</td>
            <td><img ng-src="{{item.pictureUrl}}" width="70px" height="70px"/></td>
            <td>
                <a href="javascript:;" data-toggle="modal" data-target="#confirmDeleteModal" ng-click="getDelID(item.id)">删除</a>
            </td>
        </tr>

    </table>
        <pagination page-size="pageSize" page-no="pageNo" total-size="{{nTotalSize}}" page-nums="{{nPageNums}}" start-index={{startIndex}} end-index={{lastIndex}} refresh-method="getSpecialCommodities()"></pagination>
    <confirmdeletemodal></confirmdeletemodal>
    <div class="modal fade addGoods" id="addGoods" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">添加商品</h4>
                </div>
                <div class="modal-body">
                    <form role="form" class="form-horizontal" name="addCommodiitesForm">
                        <div class="form-group">
                            <label for="firstClass" class="control-label col-sm-3">一级分类：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="firstClass" ng-model="firstSelected" ng-change="changeSecondCat()" ng-options="item.categoryName for item in firstCategories">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="secondClass" class="control-label col-sm-3">二级分类：</label>
                            <div class="col-sm-6">
                                <select id="secondClass" class="form-control" ng-model="secondSelected" ng-change="changeThirdCat()" ng-options="item.categoryName for item in secondCategories">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="thirdClass" class="control-label col-sm-3">三级分类：</label>
                            <div class="col-sm-6">
                                <select id="thirdClass" class="form-control" ng-model="thirdSelected" ng-change="getGoodsName()" ng-options="item.categoryName for item in thirdCategories">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="goodsName" class="control-label col-sm-3">商品名称：</label>
                            <div class="col-sm-6">
                                <select id="goodsName"class="form-control" ng-model="goodSelected" ng-change="getGoodsId()" ng-options="item.name for item in commodities">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="goodsID" class="control-label col-sm-3">商品编号：</label>
                            <div class="col-sm-6">
                                <input type="text" id="goodsID" name="modalName" ng-required="true" class="form-control" ng-model="commodityNo" disabled/>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" ng-click="addCommodity()" data-dismiss="modal"
                            ng-disabled="addCommodiitesForm.modalName.$invalid">确认</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>

</div>